#include "model.h"

namespace YQ {

const string &
getDefaultModelDir()
{
	static const string default_model_dir = "./models/";
	return default_model_dir;
}

template<typename T>
const string &
getDefaultModelFile()
{
	static const map<type_index, const string> default_model_files {
		{type_index (typeid (FaceDetector)), getDefaultModelDir()  + "face_detector.csta"},
		{type_index (typeid (FaceLandmarker)), getDefaultModelDir() + "face_landmarker_pts5.csta"},
		{type_index (typeid (FaceRecognizer)), getDefaultModelDir()  + "face_recognizer.csta"},
		{type_index (typeid (QualityOfPoseEx)), getDefaultModelDir() + "pose_estimation.csta"}
	};
	return default_model_files.at (type_index (typeid (T)));
}

template<typename T>
const ModelSetting &
getDefaultModelSetting()
{
	static ModelSetting setting (getDefaultModelFile<T>());
	return setting;
}


/**
 * @warning QuatityOfBrightness, QualityOfClarity无模型文件，无需实例化对应模板
*/
template const string &getDefaultModelFile<FaceDetector>();
template const string &getDefaultModelFile<FaceLandmarker>();
template const string &getDefaultModelFile<FaceRecognizer>();
template const string &getDefaultModelFile<QualityOfPoseEx>();


template const ModelSetting &getDefaultModelSetting<FaceDetector>();
template const ModelSetting &getDefaultModelSetting<FaceLandmarker>();
template const ModelSetting &getDefaultModelSetting<FaceRecognizer>();
template const ModelSetting &getDefaultModelSetting<QualityOfPoseEx>();

}